From 9c6a801f5252c07ca4afbae85f9dde6c1abfcf78 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Sat, 4 Dec 2010 15:41:42 +0900 Subject: [PATCH] Migrated GtkCellLayout documentation into the source code. Also added a section on specifying properties in the GtkCellLayout UI description. --- docs/reference/gtk/tmpl/gtkcelllayout.sgml | 186 --------------------- gtk/gtkcelllayout.c | 68 ++++++++ gtk/gtkcelllayout.h | 11 ++ 3 files changed, 79 insertions(+), 186 deletions(-) delete mode 100644 docs/reference/gtk/tmpl/gtkcelllayout.sgml diff --git a/docs/reference/gtk/tmpl/gtkcelllayout.sgml b/docs/reference/gtk/tmpl/gtkcelllayout.sgml deleted file mode 100644 index 166d2cb996..0000000000 --- a/docs/reference/gtk/tmpl/gtkcelllayout.sgml +++ /dev/null @@ -1,186 +0,0 @@ - -GtkCellLayout - - -An interface for packing cells - - - -#GtkCellLayout is an interface to be implemented by all objects which -want to provide a #GtkTreeViewColumn-like API for packing cells, setting -attributes and data funcs. - - - -One of the notable features provided by implementations of GtkCellLayout -are attributes. Attributes let you set the properties -in flexible ways. They can just be set to constant values like regular -properties. But they can also be mapped to a column of the underlying -tree model with gtk_cell_layout_set_attributes(), which means that the value -of the attribute can change from cell to cell as they are rendered by the -cell renderer. Finally, it is possible to specify a function with -gtk_cell_layout_set_cell_data_func() that is called to determine the value -of the attribute for each cell that is rendered. - - - -GtkCellLayouts as GtkBuildable - -Implementations of GtkCellLayout which also implement the GtkBuildable -interface (#GtkCellView, #GtkIconView, #GtkComboBox, #GtkComboBoxEntry, -#GtkEntryCompletion, #GtkTreeViewColumn) accept GtkCellRenderer objects -as <child> elements in UI definitions. They support a custom -<attributes> element for their children, which can contain -multiple <attribute> elements. Each <attribute> element has -a name attribute which specifies a property of the cell renderer; the -content of the element is the attribute value. - - -A UI definition fragment specifying attributes - - - - - 0 - - " - -]]> - - - - - - - - - - - - - - - - - - - - - - - - - -@g_iface: -@pack_start: -@pack_end: -@clear: -@add_attribute: -@set_cell_data_func: -@clear_attributes: -@reorder: -@get_cells: - - - -A function which should set the value of @cell_layout's cell renderer(s) -as appropriate. - - -@cell_layout: a #GtkCellLayout -@cell: the cell renderer whose value is to be set -@tree_model: the model -@iter: a #GtkTreeIter indicating the row to set the value for -@data: user data passed to gtk_cell_layout_set_cell_data_func() - - - - - - - -@cell_layout: -@cell: -@expand: - - - - - - - -@cell_layout: -@cell: -@expand: - - - - - - - -@cell_layout: -@Returns: - - - - - - - -@cell_layout: -@cell: -@position: - - - - - - - -@cell_layout: - - - - - - - -@cell_layout: -@cell: -@Varargs: - - - - - - - -@cell_layout: -@cell: -@attribute: -@column: - - - - - - - -@cell_layout: -@cell: -@func: -@func_data: -@destroy: - - - - - - - -@cell_layout: -@cell: - - diff --git a/gtk/gtkcelllayout.c b/gtk/gtkcelllayout.c index fb35428fe3..e0d8652055 100644 --- a/gtk/gtkcelllayout.c +++ b/gtk/gtkcelllayout.c @@ -17,6 +17,74 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:gtkcelllayout + * @Short_Description: An interface for packing cells + * @Title: GtkCellLayout + * + * #GtkCellLayout is an interface to be implemented by all objects which + * want to provide a #GtkTreeViewColumn-like API for packing cells, setting + * attributes and data funcs. + * + * One of the notable features provided by implementations of GtkCellLayout + * are attributes. Attributes let you set the properties + * in flexible ways. They can just be set to constant values like regular + * properties. But they can also be mapped to a column of the underlying + * tree model with gtk_cell_layout_set_attributes(), which means that the value + * of the attribute can change from cell to cell as they are rendered by the + * cell renderer. Finally, it is possible to specify a function with + * gtk_cell_layout_set_cell_data_func() that is called to determine the value + * of the attribute for each cell that is rendered. + * + * + * GtkCellLayouts as GtkBuildable + * + * Implementations of GtkCellLayout which also implement the GtkBuildable + * interface (#GtkCellView, #GtkIconView, #GtkComboBox, #GtkComboBoxEntry, + * #GtkEntryCompletion, #GtkTreeViewColumn) accept GtkCellRenderer objects + * as <child> elements in UI definitions. They support a custom + * <attributes> element for their children, which can contain + * multiple <attribute> elements. Each <attribute> element has + * a name attribute which specifies a property of the cell renderer; the + * content of the element is the attribute value. + * + * + * A UI definition fragment specifying attributes + * + * + * + * + * 0 + * + * " + * + * ]]> + * + * + * Furthermore for implementations of GtkCellLayout that use a #GtkCellArea + * to lay out cells (most, of not all GtkCellLayouts in GTK+ use a GtkCellArea) + * cell properties can also be defined + * in the format by specifying the custom <cell-packing> attribute which + * can contain multiple <property> elements defined in the normal way. + * + * A UI definition fragment specifying cell properties + * + * + * + * + * True + * False + * + * " + * + * ]]> + * + * + * + */ + #include "config.h" #include #include diff --git a/gtk/gtkcelllayout.h b/gtk/gtkcelllayout.h index 0191ab5568..26957e6b2a 100644 --- a/gtk/gtkcelllayout.h +++ b/gtk/gtkcelllayout.h @@ -41,6 +41,17 @@ typedef struct _GtkCellLayout GtkCellLayout; /* dummy typedef */ typedef struct _GtkCellLayoutIface GtkCellLayoutIface; /* keep in sync with GtkTreeCellDataFunc */ +/** + * GtkCellLayoutDataFunc: + * @cell_layout: a #GtkCellLayout + * @cell: the cell renderer whose value is to be set + * @tree_model: the model + * @iter: a #GtkTreeIter indicating the row to set the value for + * @data: user data passed to gtk_cell_layout_set_cell_data_func() + * + * A function which should set the value of @cell_layout's cell renderer(s) + * as appropriate. + */ typedef void (* GtkCellLayoutDataFunc) (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *tree_model, -- 2.30.2